nextRound
TechnologiesCoding ProblemsBookmarksLearning PathsLogin
nextRound
TechnologiesCoding ProblemsBookmarksLearning PathsLogin
Questions
1 of 13
1What is an Abstract Class? When is it used?
2What is an Interface? When is it used?
3Compare Abstract Classes and Interfaces. When would you choose one over the other?
4Can an Interface have fields? Why or why not?
5Can an Interface have a Constructor?
6What are Default Methods in Interfaces (Java 8+ / C# 8+)? Why were they introduced?
7Can an Interface inherit from another Interface?
8Can an Abstract Class implement an Interface and not define all methods?
9What are Marker Interfaces (e.g., Serializable)? Are they an anti-pattern?
10How do you achieve Loose Coupling using Interfaces? (Dependency Injection basics)
11What is 'Programming to an Interface, not an Implementation'?
12Why can't you instantiate an Interface or Abstract Class?
13Explain "Explicit Interface Implementation" (C#) and when it's needed.
OOPSOOPS
Basics
Inheritance and Composition
Polymorphism
Interfaces and Abstract Classes
Access Modifiers and Scope
Advanced Concepts and Design Principles
Trees
Real-World Design and Architecture Scenarios
01 / 13
nextRound

AI-powered interview preparation platform. Practice with curated questions, mock interviews, and personalized learning paths to crack your dream tech interview.

Quick Links

  • Technologies
  • Mock Interviews
  • Saved Questions
  • Pricing

Company

  • About Us
  • Contact Us

Legal

  • Privacy Policy
  • Terms of Use

© 2026 nextRound. All rights reserved.

What is an Abstract Class? When is it used?

Difficulty: 2/10

Abstract Class

An abstract class is a class intended to serve as a base abstraction and cannot normally be instantiated directly. It can contain both implemented methods and abstract methods that derived classes must implement. I use an abstract class when related types share common state, invariants, or implementation, while still requiring subclasses to provide specific behavior. It is particularly useful when there is a genuine IS-A relationship and some common behavior belongs in the base class.

javascript
  1. 1

    Cannot normally be instantiated directly.

  2. 2

    Can contain abstract and concrete methods.

  3. 3

    Can contain instance state and constructors.

  4. 4

    Useful for sharing common implementation among closely related types.

  5. 5

    Should represent a meaningful abstraction rather than being used merely for code reuse.

Follow-up Questions

  • Can an abstract class have a constructor?
  • Can an abstract class contain concrete methods?
  • Can an abstract class implement an interface?
  • What is the difference between an abstract class and an interface?
Sharethis question

Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.